# !/usr/bin/python



import psutil


pids = psutil.pids()

for pid in pids:

    p = psutil.Process(pid)

    print("pid-%d,pname-%s" % (pid, p.name()))

import os
import sys
import signal


def kill(pid):

    try:
        a = os.kill(pid, signal.SIGILL)
        # a = os.kill(pid, signal.9) #　与上等效
        print ('已杀死pid为%s的进程,　返回值是:%s' % (pid, a))
    except OSError as e:
        print ('没有如此进程!!!')

if __name__ == '__main__':
    kill(12532)